<template>
    <div class="w100 h100">
        <add v-if="type === 'create'" @tabChange="tabChange" :isEdit="isEdit" :applyNeedData="applyNeedData"></add>
        <Table v-else @tabChange="tabChange"></Table>
    </div>
</template>

<script>
import Add from './applyComponents/Add.vue'
import Table from './applyComponents/Table.vue'

export default {
    components: {
        Add,
        Table,
    },
    data() {
        return {
            type: 'list',
            applyNeedData: null,
            isEdit: true,
        }
    },
    methods: {
        tabChange(type, value, isEdit) {
            this.type = type
            this.applyNeedData = value
            this.isEdit = isEdit
        },
    },
}
</script>

<style lang="scss" scoped></style>
